#!/bin/bash
########################################################################
####  Script Name: sm-lib-2009-fixes-s
####  version: 1.0.1
####  Date: 2009-04-07

####  Copyright (C) Harald Hope 2009
####  This program is free software; you can redistribute it and/or modify it under
####  the terms of the GNU General Public License as published by the Free Software
####  Foundation; either version 2 of the License, or (at your option) any later version.

####  This program is distributed in the hope that it will be useful, but WITHOUT
####  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
####  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

####  Get the full text of the GPL here:
####  http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

####  Script Author: Harald Hope
####  This is a library file for smxi and cannot be run independently

####  Script URL: http://smxi.org/sm/sm-lib-2009-fixes-s
####  Script SVN: http://code.google.com/p/smxi
####  Script Home page: http://techpatterns.com/forums/about736.html
########################################################################
#### $DISTRO_VERSION numbers - in general, make distro level tests higher for
#### critical fixes and updates. Each lib will launch fixes when they are required
#### 2009: 9 10 11 12 13 - 2009 14 15 16 17
########################################################################

###---------------------------------------------------------------------
### script executor
###---------------------------------------------------------------------
# args: $1 - pre / post
run_2009_fixes()
{
	if [ "$1" == 'pre' ];then
		if [ "$DISTRO_LEVEL" -lt 17 ];then
			acroread_fix_1
		fi
		if [ "$DISTRO_LEVEL" -lt 15 ];then
			:
		fi
	elif [ "$1" == 'post' ];then
		:
	fi
}

###---------------------------------------------------------------------
### specific du fixes
###---------------------------------------------------------------------

acroread_fix_1()
{
	local prefId='acroread-fix-1'
	local smPref=$( sm_pref_tester $prefId )
	local isInstalled=$( package_tester 'acroread'  )
	local isAvailable=$( check_package_status 'acroread-debian-files' 'c' )

	if [ "$smPref" -eq 0 -a -n "$isInstalled" -a -n "$isAvailable" ];then
		echo $LINE
		echo "${S}Running ${C}acroread${S} update fix now...${N}"
		# aptitude pulls all cups stuff out... bad aptitude, bad!
		package_installer 'acroread-debian-files' 'force-always'
		set_sticky_prefs $prefId
	fi
}

###**EOF**###
